#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;

#include <windows.h>
#include <process.h>

#include "main_front.h"
#include "tracker.h"
#include "ParkinglotDB.h"

int main (int argc, char **argv) {
	CvCapture* camCapture_front = cvCaptureFromFile( "data\\ofir_enter.avi" );
	CvCapture* camCapture_top = cvCaptureFromFile( "data\\top_cam.avi" );
	_beginthread(main_front, 0, camCapture_front);
	_beginthread(initParkinglot, 0, camCapture_top);
	// here we may decide to launch another thread to be in charge of gui/command line commands.
	// (responsibility: Dima & Roey)

	Sleep(5000);
	ParkinglotDB &bla=ParkinglotDB::instance();
	bla.InitLot();

	int x=8;
	int y =480-132;
//	carArrived(cvPoint(x,y), 4038);

	cout << "main thread\n";	// if i use endl, there's a context switch before the new line :P

	string stam;
	cin >> stam;

	return 13;
}